/**
 * @author: Robert Hovhanessian
 * @CIN:    220379508
 */
package Hsearch;

import game.*;
import players.Player;


import java.util.ArrayList;
import java.util.List;

public class Subgame {
	private ArrayList<Cell> x=new ArrayList<Cell>();
	private ArrayList<Cell> C=new ArrayList<Cell>();
	private ArrayList<Cell> y=new ArrayList<Cell>();
	
	public Subgame(ArrayList<Cell>x,ArrayList<Cell>C,ArrayList<Cell>y){
		this.x=x;
		this.C=C;
		this.y=y;
	}
	
	public ArrayList<Cell> getX(){
		return x;
	}
	public ArrayList<Cell> getC(){
		return C;
	}
	public ArrayList<Cell> getY(){
		return y;
	}
	
	
	public boolean equals(Object o){
		return this.equalsTo( (Subgame) o);
	}
	public boolean equalsTo(Subgame s){
		if(s.getC().equals(this.getC()) ){
			if(    ( s.getX().equals(this.getX()) && s.getY().equals(this.getY()) )   ||   ( s.getX().equals(this.getY()) && s.getY().equals(this.getX()) )    )
			   return true;
		}
		return false;
	}
	public String toString(){
		String retVal="";
		for(Cell c:this.x){
			retVal+="<" + c.getX() + ","+ c.getY() + ">";
		}retVal+="\n";
		for(Cell c:this.C){
			retVal+="<" + c.getX() + ","+ c.getY() + ">";
		}retVal+="\n";
		for(Cell c:this.y){
			retVal+="<" + c.getX() + ","+ c.getY() + ">";
		}
		return retVal;
	}
	public Subgame Clone(){
		return this.Clone();
	}
}
